{/* LAYOUT模板 */}
<layout name="layout"/>
{/* LAYOUT模板 */}
{/* import Js,Css */}	
<css href="__THEMES__/css/common.css"/>
<css href="__CSS__/jquery-ui.css" />
<css href="__THEMES__/css/user.css" />
<js href="__JS__/core/jquery-ui.1.10.4.js"/>
<js href="__JS__/core/plugins.js"/>
{/* import js,css */}

<include file="User:l_user_nav"/>

<div id="dialog" class="hide">
	<h1 class="d-title">绑定邮箱</h1>
	<div class="space20" style="height:20px;"></div>
	<div class="check-mail-wrap">		
		<ul class="clearfix">
			<li>
				<input id="email" class="input" name="email" value="992156583@qq.com"/>
			</li>		
			<li>
				<button id="send-touser-btn" class="qs-send-btn">发送验证邮件</button>
			</li>
		</ul>
		<div>
			<div class="clearfix">
				<input id="code" class="input fl" style="width:60px;margin:15px 0px 0px 30px;" name="code" value=""/>
				<div style="line-height:40px;margin:15px 0px 0px 30px;display:inline-block;float:left;">输入验证码</div>
			</div>
			<div>
				<span id="qs-check-btn" class="dp qs-send-btn" style="display:block;margin:15px 0px 0px 30px;line-height:33px;">绑定邮箱</span>
			</div>
			<p style="width:80%;display:block;font-size:12px;margin-left:30px; border:1px solid #FF3D00;margin-top:15px;line-height:20px;">
				<b style="color:red;font-size:14px;">Tips:</b>
				<br/>
				在60内还没有没有收到音伴尔发给你的官方邮件，点击重新发送！
			</p>
		</div>		
	</div>
</div>

<div id="loading"></div>


<!--用户中心导航-->
<div class="">
	<div class="w_1200 mp20 clearfix">
		<!--左边栏-->
		<div class="LBanner fl w20">
			<include file="User:user_menu"/>
		</div>
		<!--左边栏-->
		<!--右边栏-->
		<div class="RBanner fr w79">			
			<div class="xm-line-box uc-box">
				<div class="box-hd hide">
					<h3 class="title">
						我的订单
					</h3>
					<div class="more">
						<div class="uc-order-list-type">
							<a class="current" href="http://order.mi.com/user/order?r=87817961_t1410778176">
								全部订单
							</a>
							<span class="sep">
								|
							</span>
							<a href="http://order.mi.com/user/order/7?r=87817961_t1410778176">
								未支付订单
							</a>
							<span class="sep">
								|
							</span>
							<a href="http://order.mi.com/user/recharge?r=87817961_t1410778176">
								话费充值订单
							</a>
							<span class="sep">
								|
							</span>
							<a href="http://order.mi.com/user/order/5?r=87817961_t1410778176">
								已关闭订单
							</a>
						</div>
					</div>
				</div>
			</div>
			<!--右边对应左边栏内容-->
			<!-- *用户中心默认显示页面 start-->
				<if condition="$action eq 'info'">
					<div class="xm-line-box uc-box">
						<div class="box-hd">
							<h3 class="title">
								我的个人中心
							</h3>
						</div>
						<div class="">
							<div class="space20" style="height:20px;"></div>
							<font class="f5" style="font-size:16px;display:block;height:30px;line-height:30px;">
								<b class="f4" style="color:#00A1E9;">{$info.username}</b> ，欢迎您回来
							</font>
							<br/>
							<div class="blank"></div>
							<!--登陆时间-->								
								<font class="f5" style="font-size:14px;display:block;height:30px;line-height:30px;">
									{$lang.last_time} ：<b class="f4">[  {$info.last_time} ]</b>
								</font>
							<!--登陆时间-->
							<br/>
							<div class="blank5"></div>
							<!--会员等级-->
								<font class="f5" style="font-size:14px;display:block;height:30px;line-height:30px;">
									{$rank_name} ：<b class="f4">[ {$next_rank_name} ]</b>
								</font>
							<!--会员等级-->
							<br/>
							<div class="blank5"></div>
							<!--邮箱验证-->
							<if condition="$info['is_validate'] eq 0">								
								<font class="f5" style="font-size:14px;display:block;height:30px;line-height:30px;">
									{$lang.not_validated} 
									<a href="#" id="send_mail_btn" style="color:#006bd0;">{$lang.resend_hash_mail}</a><br/>									
								</font>	
							<else/>
								<font class="f5" style="font-size:14px;display:block;height:30px;line-height:30px;color:green;">
									邮箱已绑定								
								</font>
							</if>
							<!--邮箱验证-->
							<!--手机绑定--><!--手机绑定-->
							<!--公告-->
							<div class="hide" style="margin:5px 0; border:1px solid #a1675a;padding:10px 20px; background-color:#e8d1c9;">
								<img src="__THEMES__/images/note.gif" alt="note" />
								&nbsp;{$user_notice}
							</div>
							<!--公告-->
							<div class="r clearfix hide">
								<!--我的账户-->
								<div class="f_l" style="width:350px;">
									<h5>
										<span>{$lang.your_account}</span>
									</h5>
									<div class="blank"></div>
									{$lang.your_surplus}:<a href="user.php?act=account_log" style="color:#006bd0;">{$info.surplus}</a><br />
									<if condition="$info['credit_line'] gt 0">
										{$lang.credit_line}:{$info.formated_credit_line}<br />
									</if>
									{$lang.your_bonus}:<a href="user.php?act=bonus" style="color:#006bd0;">{$info.bonus}</a><br />
									{$lang.your_integral}:{$info.integral}<br />
								</div>
								<!--我的账户-->
								<!--用户提醒-->
								<div class="f_r hide" style="width:350px;">
									<h5>
										<span>{$lang.your_notice}</span>
									</h5>
									<div class="blank"></div>
									<volist name="prompt" id="item">
										{$item.text}<br />
									</volist>
									{$lang.last_month_order}{$info.order_count}{$lang.order_unit}<br />
									<if condition="$info['shipped_order']">
									{$lang.please_received}<br />
									<volist name="$info['shipped_order']" id="item">
										<a href="user.php?act=order_detail&order_id={$item.order_id}" style="color:#006bd0;">{$item.order_sn}</a>
									</volist>
									</if>
								</div>
								<!--用户提醒-->
							</div>
						</div>						
					</div>	
				</if>
				<!-- #用户中心默认显示页面 end-->
			<!--右边对应左边栏内容-->
		</div>
		<!--右边栏-->
	</div>
</div>
<!--用户中心导航-->
<style>
#dialog .d-title{display:block;height:40px;font-size:20px;line-height:35px;text-indent:20px;border-bottom:2px solid #009DE4;color:#009DE4;}
#dialog .input{
	display: block;
	width: 220px;
	padding: 3px;
	font-size: 14px;
	line-height: 20px;
	color: #555;
	vertical-align: middle;
	border: 1px solid #ccc;
}
#dialog .qs-close-button-1{color:#404040;position:absolute;top:-3px;right:-43px;width:45px;line-height:43px;text-align:center;height:45px;font-size:30px;background-color:#fff;cursor:pointer;}
#dialog .check-mail-wrap{display:block;relative;}
#dialog .check-mail-wrap ul{margin-left:30px;}
#dialog .check-mail-wrap li{display:block; float:left;}
.qs-send-btn{font-size:16px;outline:none;height:33px;width:100px;border:1px solid #FF3D00;background-color:#fff;color:#FF3D00;cursor:pointer;border-radius:3px;margin-left:20px;vertical-align:center;text-align:center;}
</style>

<script>
	/*弹出发送邮件框*/
	var _dialog = null;
	$('#send_mail_btn').click(function(){
		var _dialog  = $('#dialog').Qdialog({
			width:500,
			height:300,
			modal:true
		});
	});
	/*发送邮件*/
	$('#send-touser-btn').click(function(){	
		var email = $('#email').val();
		if(email == ''){ alert('邮箱不能为空'); return; }
		/*正则表达式*/
		var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
		if(reg.test(email)){
			$.ajax({
				url:'__URL__/send_email',
				type:'post',
				dataType:'json',
				data:{email:email},
				beforeSend:function(){
					$('#loading').QLoading({text:'发送中',status:'open'});
				},
				success:function(msg){
					$('#loading').QLoading({text:'发送中',status:'close'});
				}
			});
		}
		else{
			alert('邮箱格式不正确,请重新填写');
		}
	});	
	/*验证并绑定邮箱*/
	$('#qs-check-btn').click(function(){
		alert('789');
		//$('#dialog').dialog('close');
		var datas = $('.check-mail-wrap').QVal();
		$.ajax({
			url:'__URL__/check_email',
			type:'post',
			dataType:'json',
			data:datas,
			beforeSend:function(){
				$('#loading').QLoading({text:'正在验证...',status:'open'});
			},
			success:function(msg){
				$('#loading').QLoading({text:'邮箱绑定成功',status:'close',time:0.5});
				$('#dialog').dialog('close');
			}
		});		
	});
</script>


<include file="Library:service"/>
<include file="Library:footer"/>


